supernova: fixes for boost-1.49 and gcc-4.7
[supercollider.git] / Help / UGens / Synth control / Demand Rate / Dpoll.html
blob23b5d5333b686f0eacfba5f74485e3a1f1b4bdff
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
2 <html>
3 <head>
4 <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
5 <meta http-equiv="Content-Style-Type" content="text/css">
6 <title></title>
7 <meta name="Generator" content="Cocoa HTML Writer">
8 <meta name="CocoaVersion" content="949.35">
9 <style type="text/css">
10 p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica}
11 p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px}
12 p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; color: #ad140d}
13 p.p4 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco; min-height: 12.0px}
14 p.p5 {margin: 0.0px 0.0px 0.0px 0.0px; font: 9.0px Monaco}
15 span.s1 {font: 18.0px Helvetica}
16 span.s2 {color: #0024f8}
17 span.s3 {color: #0033f1}
18 span.s4 {font: 12.0px Helvetica; color: #000000}
19 span.s5 {color: #001bb9}
20 span.s6 {color: #000000}
21 span.s7 {color: #606060}
22 span.Apple-tab-span {white-space:pre}
23 </style>
24 </head>
25 <body>
26 <p class="p1"><span class="s1"><b>Dpoll</b></span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>print the current output value of a demand rate UGen</b></p>
27 <p class="p2"><br></p>
28 <p class="p1">superclass: DUGen</p>
29 <p class="p2"><br></p>
30 <p class="p2"><br></p>
31 <p class="p1"><span class="Apple-tab-span"> </span><b>*new(in, label)</b></p>
32 <p class="p2"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span></p>
33 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>in</b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>ugen to poll vaues from</p>
34 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>label</b> <span class="Apple-tab-span"> </span>a label string</p>
35 <p class="p1"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><b>run</b><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>active if 1, inactive if 0. can be a demand ugen (default: 1)</p>
36 <p class="p2"><span class="Apple-tab-span"> </span></p>
37 <p class="p1"><span class="Apple-tab-span"> </span>the print-out is in the form: <b>label: value block offset: offset.</b></p>
38 <p class="p2"><span class="Apple-tab-span"> </span></p>
39 <p class="p1"><span class="Apple-tab-span"> </span>structurally related: <a href="../../Triggers/Poll.html"><span class="s2"><b>Poll</b></span></a><span class="Apple-tab-span"> </span></p>
40 <p class="p1"><span class="Apple-tab-span"> </span>see also: <a href="Demand.html"><span class="s3"><b>Demand</b></span></a></p>
41 <p class="p2"><span class="Apple-tab-span"> </span></p>
42 <p class="p2"><span class="Apple-tab-span"> </span></p>
43 <p class="p1"><b>WARNING: Printing values from the Server in intensive for the CPU. Poll should be used for debugging purposes.</b></p>
44 <p class="p2"><span class="Apple-tab-span"> </span></p>
45 <p class="p2"><span class="Apple-tab-span"> </span></p>
46 <p class="p3"><span class="s4"><span class="Apple-tab-span"> </span></span>// examples</p>
47 <p class="p4"><span class="Apple-tab-span"> </span></p>
48 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">Duty</span>.kr(0.5, 0, <span class="s5">Dpoll</span>(<span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>) * 2)); 0.0 }.play;</p>
49 <p class="p4"><span class="Apple-tab-span"> </span></p>
50 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// posts only when cursor is in right half of the screen</p>
51 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">Duty</span>.kr(0.5, 0, <span class="s5">Dpoll</span>(<span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>) * 2, run: <span class="s5">MouseX</span>.kr &gt; 0.5)); 0.0 }.play;</p>
52 <p class="p4"><br></p>
53 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// label</p>
54 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">LFPulse</span>.ar(<span class="s5">Duty</span>.kr(0.5, 0, <span class="s5">Dpoll</span>(<span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>) % 10 + 1 * 30, <span class="s7">"value"</span>))) * 0.1 }.play;</p>
55 <p class="p4"><span class="Apple-tab-span"> </span></p>
56 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// block offset:</p>
57 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">Duty</span>.ar(0.511, 0, <span class="s5">Dpoll</span>(<span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>) * 2)); 0.0 }.play;</p>
58 <p class="p4"><br></p>
59 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// multichannel expansion:</p>
60 <p class="p4"><span class="Apple-tab-span"> </span></p>
61 <p class="p5"><span class="Apple-tab-span"> </span>(</p>
62 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>{<span class="Apple-converted-space"> </span></p>
63 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s5">var</span> x = <span class="s5">Duty</span>.kr(0.5, 0,<span class="Apple-converted-space"> </span></p>
64 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s5">Dpoll</span>([<span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>), <span class="s5">Dgeom</span>(1, 1.1, <span class="s5">inf</span>)], [<span class="s7">"first"</span>, <span class="s7">"second"</span>])</p>
65 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>);</p>
66 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span><span class="s5">LFPulse</span>.ar(100 + (x * 100)) * 0.1</p>
67 <p class="p5"><span class="Apple-tab-span"> </span><span class="Apple-tab-span"> </span>}.play</p>
68 <p class="p5"><span class="Apple-tab-span"> </span>)</p>
69 <p class="p4"><span class="Apple-tab-span"> </span></p>
70 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">Duty</span>.kr(0.5, 0, <span class="s5">Dpoll</span>(( <span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>) + <span class="s5">_</span> ).dup, (<span class="s7">"value"</span> + <span class="s5">_</span>).dup)); 0.0 }.play;<span class="Apple-tab-span"> </span></p>
71 <p class="p4"><br></p>
72 <p class="p4"><br></p>
73 <p class="p3"><span class="s6"><span class="Apple-tab-span"> </span></span>// the message dpoll(label, run, trigid) is a shorthand:</p>
74 <p class="p4"><span class="Apple-tab-span"> </span></p>
75 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">Duty</span>.kr(0.5, 0, <span class="s5">Dseries</span>(0, 1, <span class="s5">inf</span>).dpoll); 0.0 }.play;</p>
76 <p class="p5"><span class="Apple-tab-span"> </span>{ <span class="s5">Duty</span>.ar(0.5, 0, <span class="s5">SinOsc</span>.ar(0.1).dpoll); 0.0 }.play;</p>
77 <p class="p4"><br></p>
78 <p class="p4"><br></p>
79 <p class="p4"><br></p>
80 <p class="p4"><br></p>
81 </body>
82 </html>